//
//  ViewController.m
//  上传
//
//  Created by Justsoso on 16/3/30.
//  Copyright © 2016年 Justsoso. All rights reserved.
//

#import "ViewController.h"

#define kBoundary @"niit123456"
#define kNewLine @"\r\n"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self uploadFile];
}

- (void)uploadFile
{
    NSURL *url = [NSURL URLWithString:@"http://localhost:8080/MJServer/upload"];
    
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    
    request.HTTPMethod = @"POST";
    
    NSString *headerStr = [NSString stringWithFormat:@"multipart/form-data;boundary=%@",kBoundary];
    [request setValue:headerStr forHTTPHeaderField:@"Content-Type"];
    
    
}
@end
